<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>加密用户名</title>
    <script>
      function processUsername(username) {
        return username.charAt(0) + '*'.repeat(username.length - 1)
      }

      //S*******
      console.log(processUsername('Sherlock'))
      //T**
      console.log(processUsername('Tom'))
      //张**
      console.log(processUsername('张三丰'))
    </script>
  </head>
  <body></body>
</html>
